<!DOCTYPE html>
<html>
<head>
<title>资金管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">
<script type="text/javascript">
	$.canEdit = true;
</script>
<script type="text/javascript">
	$.canAdd = true;
</script>
<script type="text/javascript">
	var dataGrid;
	var winWidth =  700;
	var winHeight = 400;
	var addTitle = "线下充值银行账户添加"; //添加窗口标题
	var addUrl =  "/modules/account/recharge/offlinebank/offlinebankAddPage.html"; // 添加窗口链接地址
	var editTitle = "线下充值银行账户编辑";
	var editUrl =  "/modules/account/recharge/offlinebank/offlinebankEditPage.html";
	var editWinParmeters = "'{0}','"+editTitle+"',"+winWidth+","+winHeight+",'"+editUrl+"'";
	var addWinParmeters = "'{0}','"+addTitle+"',"+winWidth+","+winHeight+",'"+addUrl+"'";
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'payOfflinebankList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [
			{ field: 'id', title: '编号', width: 50, fixed: true,checkbox : false},
				{ field: 'owner', title: '拥有者', width: 100, checkbox : false},
				{ field: 'bankNo', title: '账号', width: 150, sortable:false },
				{ field: 'status', title: '状态', width: 50,fixed: true, checkbox : false,
					formatter: function(value,row,index){
						if (value == 1){
							return "禁用";
						} else if(value == 2){
							return "启用";
						}
						return "";
					}	
				},
				{ field: 'bank', title: '银行', width: 100, sortable:false },
				{ field: 'branch', title: '支行', width: 100, sortable:false },
				{ field: 'province', title: '开户所在地', width: 150, sortable:false,formatter:function(value, row, index){
					var str ="";
					if(row.province) str += row.province; 
					if(row.city) str += row.city; 
					if(row.area) str += row.area; 
					return str;
				}},
				{ field: 'addTime', title: '添加时间', width: 150, sortable:false,
					formatter: function(value,row,index){
						if (value){
							return getLocalTime(value,4);
						} else {
							return "";
						}
					}	
				},
				{ field: 'addIp', title: '添加IP', width: 100, sortable:false },
				  {	field : 'action',
					title : '操作',
					fixed: true,
					width :80,
					formatter : function(value, row, index) {
						var str = '';
						if ($.canAdd) {
							str += $.formatString('<img onclick="$.fn.dataGridOptions.addFun('+addWinParmeters+');" src="{1}" title="线下充值银行账户添加"/>', row.id, '${theme_dir}/css/images/extjs_icons/pencil_add.png');
						}
						str += '&nbsp;';
						if ($.canEdit) {
							str = $.formatString('<img onclick="$.fn.dataGridOptions.editFun('+editWinParmeters+');" src="{1}" title="线下充值银行账户编辑"/>', row.id, '${theme_dir}/css/images/extjs_icons/pencil.png');
						}
						str += '&nbsp;';
						return str;
					}
				} 
			] ],
			toolbar : '#toolbar',
		});
	});
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	                <input type="text" name="searchName" class="sInput" placeholder="输入账户拥有者/账号进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a>
	            </form>
            </div>
            <div class="sRight">
            	<a onclick="$.fn.dataGridOptions.addFun(-1,addTitle,winWidth,winHeight,addUrl);" href="javascript:void(0);" class="addBtn"><i class="iconfont">&#xe629;</i>添加</a>
            </div>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>
